using System;
using System.Data;
using System.Collections.Generic;
using Soccer.Core;
using Soccer.Utility;

namespace Soccer.Business
{
    [TableAttribute("VoteQuestions")]
	[Serializable]
    public class VoteQuestion : DBO<VoteQuestion>
    {
		#region Fields
		
		private int? _IdVoteQuestion;
		private string _Content;
		private bool? _IsActived;
		private DateTime? _CreatedDate;
		private DateTime? _LastModifiedDate;
		
		#endregion
		
		#region Constructors
		/// <summary>
		/// Default constructor
		/// </summary>
		public VoteQuestion()
		{
			
		}
		
		/// <summary>
		/// Constructor with IdVoteQuestion 
		/// </summary>
		/// <param name="IdVoteQuestion">The IdVoteQuestion</param>
		public VoteQuestion(int? IdVoteQuestion )
		{
			this.IdVoteQuestion = IdVoteQuestion;
		}
		
		/// <summary>
		/// Constructor with all parameters
		/// </summary>
		/// <param name="IdVoteQuestion">Sets int? value for IdVoteQuestion</param>
		/// <param name="Content">Sets string value for Content</param>
		/// <param name="IsActived">Sets bool? value for IsActived</param>
		/// <param name="CreatedDate">Sets DateTime? value for CreatedDate</param>
		/// <param name="LastModifiedDate">Sets DateTime? value for LastModifiedDate</param>
		public VoteQuestion(int? idVoteQuestion, string content, bool? isActived, DateTime? createdDate, DateTime? lastModifiedDate)
		{
			this.IdVoteQuestion = idVoteQuestion;
			this.Content = content;
			this.IsActived = isActived;
			this.CreatedDate = createdDate;
			this.LastModifiedDate = lastModifiedDate;
		}
		
		#endregion
		
		#region Properties
		
		/// <summary>
		/// Gets or sets int? value for IdVoteQuestion
		/// </summary>
		[ColumnAttribute("IdVoteQuestion", SqlDbType.Int , 4 , true, true, false)]
		public int? IdVoteQuestion
		{
			set
			{
				this._IdVoteQuestion = value;
			}
			get
			{
				return this._IdVoteQuestion;
			}
		}
		
		/// <summary>
		/// Gets or sets string value for Content
		/// </summary>
		[ColumnAttribute("Content", SqlDbType.NVarChar , -1 , false, false, true)]
		public string Content
		{
			set
			{
				this._Content = value;
			}
			get
			{
				return this._Content;
			}
		}
		
		/// <summary>
		/// Gets or sets bool? value for IsActived
		/// </summary>
		[ColumnAttribute("IsActived", SqlDbType.Bit , 1 , false, false, true)]
		public bool? IsActived
		{
			set
			{
				this._IsActived = value;
			}
			get
			{
				return this._IsActived;
			}
		}
		
		/// <summary>
		/// Gets or sets DateTime? value for CreatedDate
		/// </summary>
		[ColumnAttribute("CreatedDate", SqlDbType.DateTime , 8 , false, false, true)]
		public DateTime? CreatedDate
		{
			set
			{
				this._CreatedDate = value;
			}
			get
			{
				return this._CreatedDate;
			}
		}
		
		/// <summary>
		/// Gets or sets DateTime? value for LastModifiedDate
		/// </summary>
		[ColumnAttribute("LastModifiedDate", SqlDbType.DateTime , 8 , false, false, true)]
		public DateTime? LastModifiedDate
		{
			set
			{
				this._LastModifiedDate = value;
			}
			get
			{
				return this._LastModifiedDate;
			}
		}
		
		
		/// <summary>
		/// Get a list VoteAnswer of current VoteQuestion object base on IdVoteQuestion
		/// </summary>
		public List<VoteAnswer> VoteAnswerListForIdVoteQuestion
		{
			get
			{
				if (this.IdVoteQuestion == null)
					return null;
				VoteAnswer condition = new VoteAnswer();
				condition.IdVoteQuestion = this.IdVoteQuestion;
				return VoteAnswerController.FindItems(condition);
			}
		}
		
		#endregion
        
        #region Other Properties
        private static ColumnNameStruct? _ColumnName;
        public static ColumnNameStruct ColumnName
        {
            get
            {
                if (!_ColumnName.HasValue)
                    _ColumnName = new ColumnNameStruct();
                return _ColumnName.Value;
            }
        }
        #endregion

        #region NestedType
        public  struct ColumnNameStruct
        {
            /// <summary>
            /// Get the name of column [IdVoteQuestion]
            /// </summary>
            public string IdVoteQuestion
            {
                get
                {
                    return "IdVoteQuestion";
                }
            }
            /// <summary>
            /// Get the name of column [Content]
            /// </summary>
            public string Content
            {
                get
                {
                    return "Content";
                }
            }
            /// <summary>
            /// Get the name of column [IsActived]
            /// </summary>
            public string IsActived
            {
                get
                {
                    return "IsActived";
                }
            }
            /// <summary>
            /// Get the name of column [CreatedDate]
            /// </summary>
            public string CreatedDate
            {
                get
                {
                    return "CreatedDate";
                }
            }
            /// <summary>
            /// Get the name of column [LastModifiedDate]
            /// </summary>
            public string LastModifiedDate
            {
                get
                {
                    return "LastModifiedDate";
                }
            }
        }
        #endregion
    }
}
